<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/file.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_filetool.js"></script>
		<script type="text/javascript">
			$(document).ready(function () {
				var height = $(window).height();
				var dialog_list_height = height - 190;
				$('.dialog_list').css('height', dialog_list_height);
				banpageKey();

				$('input[type=checkbox],input[type=radio]').espcms_checkbox();

				var old_inputname = parent.$('#[%$inputname%]').val();
				if (old_inputname) {
					$('#select_id_list').val(old_inputname);
				}
			});
			var upfileType = '[%$upfileType%]';
			var selectnum = '[%$selectnum%]';
			var inputname = '[%$inputname%]';
			var updatediv = '[%$updatediv%]';
			var displaytype = '[%$displaytype%]';

			function closedialogbox() {
				parent.closeifram();
			}

			function returnInputFile(file, fileurl, title, filesize, fileext) {
				if (!file) {
					closedialogbox();
				}

				if (displaytype === 'pic') {
					parent.frames['[%$iframes_name%]'].into_input_value(file, inputname);
					parent.frames['[%$iframes_name%]'].repce_div_pic_input(fileurl, updatediv, inputname);
				}

				if (displaytype === 'inputfile') {
					parent.frames['[%$iframes_name%]'].into_input_value(file, inputname);
				}

				if (displaytype === 'photolist') {
					parent.frames['[%$iframes_name%]'].add_article_pic(file, fileurl, inputname, updatediv);
				}

				if (displaytype === 'filelist') {
					var fileArray = file.split(',');
					var html = '';
					if (fileArray.length > 1) {
						var titleArray = title.split(',');
						var sizeArray = filesize.split(',');
						var extArray = fileext.split(',');
						for (var i = 0; i < fileArray.length; i++) {
							html = html + '<tr><td class="text-center"><input type="hidden" name="filetitle_list[]" value="' + titleArray[i] + '">' +
								'<input type="hidden" name="filepath_list[]" value="' + fileArray[i] + '">' +
								'<input type="hidden" name="fileext_list[]" value="' + extArray[i] + '">' +
								'<input type="hidden" name="filesize_list[]" value="' + sizeArray[i] + '">' +
								'<div class="input-group"><input type="text" class="form-control" name="filecontent_list[]" placeholder="[%pack:filemanage_pack-espcms_lable_filemanage_content%]" title="[%pack:filemanage_pack-espcms_lable_filemanage_content%]" value="' + titleArray[i] + '"/><div class="input-group-addon">' + fileArray[i] + '</div></div>' +
								'</td><td class="filelist_del_botton"><a title="[%pack:botton_pack-espcms_botton_del%]" class="del_botton file_del icon_botton"><i class="espcms_icon_fa espcms_icon_fa-trash"></i></a></td></tr>';

						}
					} else {
						html = '<tr><td class="text-center"><input type="hidden" name="filetitle_list[]" value="' + title + '">' +
							'<input type="hidden" name="filepath_list[]" value="' + file + '">' +
							'<input type="hidden" name="fileext_list[]" value="' + fileext + '">' +
							'<input type="hidden" name="filesize_list[]" value="' + filesize + '">' +
							'<div class="input-group"><input type="text" class="form-control" name="filecontent_list[]" placeholder="[%pack:filemanage_pack-espcms_lable_filemanage_content%]" title="[%pack:filemanage_pack-espcms_lable_filemanage_content%]" value="' + title + '"/><div class="input-group-addon">' + file + '</div></div>' +
							'</td><td class="filelist_del_botton"><a title="[%pack:botton_pack-espcms_botton_del%]" class="del_botton file_del icon_botton"><i class="espcms_icon_fa espcms_icon_fa-trash"></i></a></td></tr>';

					}
					parent.frames['[%$iframes_name%]'].espcms_addFilelist(updatediv, html);
				}

				if (displaytype === 'editpic') {
					var fileArray = file.split(',');
					var fileUrlArray = fileurl.split(',');
					var titleArray = title.split(',');
					if (fileArray.length === 1) {
						parent.frames['[%$iframes_name%]'].UE.getEditor(inputname).execCommand('insertHtml', '<p style="text-align: center;"><img class="img-responsive" src="' + fileurl + '" alt="' + title + '"/></p>');
					} else if (fileArray.length > 1) {
						var html = '';
						for (var i = 0; i < fileArray.length; i++) {
							html = html + '<p style="text-align: center;"><img class="img-responsive" src="' + fileUrlArray[i] + '" alt="' + titleArray[i] + '"/></p>'
						}
						parent.frames['[%$iframes_name%]'].UE.getEditor(inputname).execCommand('insertHtml', html);
					}
				}

				if (displaytype === 'editmover') {
					var fileArray = file.split(',');
					var fileUrlArray = fileurl.split(',');
					if (fileArray.length === 1) {
						parent.frames['[%$iframes_name%]'].UE.getEditor(inputname).execCommand('insertHtml', '<p style="text-align: center;"><embed type="application/x-shockwave-flash" video_fileurl="[%$ESPCMS_URL_NOLINE%]' + fileurl + '" flashvars="video=[%$ESPCMS_URL_NOLINE%]' + fileurl + '" class="edui-faked-video" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.ecisp.cn/ckplayer/ckplayer.swf" width="480" height="400" wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="always" allowfullscreen="true"/></p>');
					} else if (fileArray.length > 1) {
						var html = '';
						for (var i = 0; i < fileArray.length; i++) {
							html = html + '<p style="text-align: center;"><embed type="application/x-shockwave-flash" video_fileurl="[%$ESPCMS_URL_NOLINE%]' + fileUrlArray[i] + '" flashvars="video=[%$ESPCMS_URL_NOLINE%]' + fileUrlArray[i] + '" class="edui-faked-video" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.ecisp.cn/ckplayer/ckplayer.swf" width="480" height="400" wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="always" allowfullscreen="true"/></p>';
						}
						parent.frames['[%$iframes_name%]'].UE.getEditor(inputname).execCommand('insertHtml', html);
					}
				}

				if (displaytype === 'editfilelink') {
					var fileArray = file.split(',');
					var fileUrlArray = fileurl.split(',');
					var titleArray = title.split(',');
					var iconDir = '[%$ESPCMS_URL%]espcms_includes/fileimage/';
					var icon;
					if (fileArray.length === 1) {
						icon = iconDir + getFileIcon(fileurl);
						var html = '<p style="line-height: 20px;">' +
							'<img style="vertical-align: middle; margin-right: 2px;" src="' + icon + '" _src="' + icon + '" />' +
							'<a style="font-size:12px; color:#0066cc;" target="_blank" href="' + fileurl + '" title="' + title + '">' + title + '</a>' +
							'</p>';
						parent.frames['[%$iframes_name%]'].UE.getEditor(inputname).execCommand('insertHtml', html);
					} else if (fileArray.length > 1) {
						var html = '';
						for (var i = 0; i < fileArray.length; i++) {
							icon = iconDir + getFileIcon(fileArray[i]);
							html = html + '<p style="line-height: 20px;">' +
								'<img style="vertical-align: middle; margin-right: 2px;" src="' + icon + '" _src="' + icon + '" />' +
								'<a style="font-size:12px; color:#0066cc;" target="_blank" href="' + fileUrlArray[i] + '" title="' + titleArray[i] + '">' + titleArray[i] + '</a>' +
								'</p>';
						}
						parent.frames['[%$iframes_name%]'].UE.getEditor(inputname).execCommand('insertHtml', html);
					}
				}
				closedialogbox();
			}
		</script>
	</head>
	<body class="dialog_body">
		<div class="dialogContent">
			<div class="tabbable" style="margin-bottom: 18px;">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#tab1" data-toggle="tab">文件上传</a></li>
					[%if $selectnum>1%]
					<li><a href="#tab2" data-toggle="tab">批量上传</a></li>
					[%/if%]
					[%if $upfileType=='image'%]
					<li><a href="#tab3" data-toggle="tab">相册浏览模式</a></li>
					[%/if%]
					<li><a href="#tab4" data-toggle="tab">文件夹浏览模式</a></li>
				</ul>
				<div class="dialog_tab_list">
					<div class="tab-content">
						<div class="tab-pane active" id="tab1"><iframe name="upfilewindow" class="upfilewindow" src="[%$upfile%]" width="100%" height="[%$digheight%]" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>
						[%if $selectnum>1%]
						<div class="tab-pane" id="tab2"><iframe name="upbatfilewindow" class="upbatfilewindow" src="[%$batupfile%]" width="100%" height="[%$digheight%]" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>
						[%/if%]
						[%if $upfileType=='image'%]
						<div class="tab-pane" id="tab3"><iframe name="piclist" class="piclist" src="[%$photoindex%]" width="100%" height="[%$digheight%]" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>
						[%/if%]
						<div class="tab-pane" id="tab4"><iframe name="filelist" class="filelist" src="[%$dirindex%]" width="100%" height="[%$digheight%]" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
